<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model app\models\Qa */

$this->title = $content->title;
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="qa-view">

    <h3><?php echo Html::encode($this->title) ?></h3>
    <p><img src="<?php echo $author->avatar ? $author->avatar : '../images/default/avatar.jpg' ?>" width="25" height="25"/> &nbsp;&nbsp;<?php echo $author->username ?>&nbsp;&nbsp;&nbsp;<?php echo Yii::$app->formatter->asRelativeTime($content->created_at); ?> 提问</p>
    <hr>
    <!--内容-->
    <div>
        <?php echo Html::encode($content->body); ?>
    </div>
    <hr>
    <!--回答列表-->
    <div class="comments">
        <div class="media">
            <div class="media-left">
                <?php if ($comment->best_answer): ?>
                    <div class="best-answers">最佳答案</div>
                <?php endif; ?>
            </div>
            <div class="media-body">
                <h5 class="media-heading" id="media-heading">
                    <a href="/user/view?id=<?php echo $comment->author->id; ?>" target="_blank"><?php echo $comment->author->username ?></a>&nbsp;&nbsp;<?php echo Yii::$app->formatter->asRelativeTime($comment->created_at) ?>
                    <span class="pull-right">
                        <a href="/user/view?id=<?php echo $comment->author->id; ?>" target="_blank">
                            <img class="media-object" src="<?php echo $comment->author->avatar ? $comment->author->avatar : '../images/default/avatar.jpg' ?>" width="25" height="25">
                        </a>
                    </span>
                </h5>
                <div><?php echo $comment->body ?></div>
                <small class="default-color"><a href="/comments/view?id=<?php echo $comment->id ?>">链接</a></small>
            </div>
        </div>
    </div>
</div>
